package com.egitim.panels;

 
import java.util.List;

import javax.inject.Inject;

import org.apache.wicket.markup.html.list.ListItem;
import org.apache.wicket.markup.html.list.ListView;
import org.apache.wicket.markup.html.panel.Panel;

import com.egitim.cati.EtiketQueryBean;
import com.egitim.model.BaseEntity;
import com.egitim.model.Etiket;

public class EtiketListesiPanel extends Panel {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
  
    
	public EtiketListesiPanel(String id) {
		super(id);
		ListView<BaseEntity> listView=new  ListView<BaseEntity>("etiketListesi", etiketListGetir()) {
	          
	   		/**
	   		 * 
	   		 */
	   		private static final long serialVersionUID = 1L;

	   		@Override
	   		protected void populateItem(ListItem<BaseEntity> item) {
	   			// TODO Auto-generated method stub
	   			item.add(new TekEtiketPanel("tekEtiketPanel",  item.getModelObject()));
	   		 }
	    
	   	};

	   	     add(listView);
   }
	@Inject EtiketQueryBean etiketQueryBean;
	private List<Etiket>  etiketListGetir(){
		  etiketQueryBean.getAllByDesc();
		  return  etiketQueryBean.getResultList();
	}
}
